package com.example.helloworld.view;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;

import com.example.helloworld.R;

public class OriginalPictureView extends Activity {

	private ImageView image;
	private String filename;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.pictureview);
		
		image =	(ImageView)findViewById(R.id.imageView);
		processIntent();
	}
	
	private void processIntent() {
		Intent intent =	getIntent();
		Bundle extras =	intent.getExtras();
		filename =		extras.getString("filename");
		
		BitmapFactory.Options options =	new BitmapFactory.Options();
		options.inSampleSize = 2;
		
		Bitmap bitmap =	BitmapFactory.decodeFile(filename, options);
		
		image.setImageBitmap(bitmap);
	}
	 
}
